package controllers

import (
	"hello/models"

	"github.com/astaxie/beego"
)

type UserController struct {
	beego.Controller
}

func (this *UserController) Get() {
	this.TplName = "login.tpl"
}
func (this *UserController) Post() {
	uname := this.Ctx.Request.FormValue("x_username")
	pwd := this.Ctx.Request.FormValue("x_password")
	link := models.NewLink()
	link.Title = uname
	link.Href = pwd
	link.Insert()
	this.Ctx.WriteString(uname + pwd)
}
